using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UpgradeFinishingShot:Upgrade {

	int shotFired = 0;
	int lastBurstShotFired;

	protected override void BurstDecidingEventHandler(object _sender,BurstDecidingEventArgs e) {
		base.BurstDecidingEventHandler(_sender,e);
		e.stat.shots.AddLast("finishingShot");
		shotFired=0;
	}

	protected override void ShootingEventHandler(object _sender,ShootEventArgs e) {
		base.ShootingEventHandler(_sender,e);

		if(e.stat.shotTag!="finishingShot") {
			shotFired++;
			return;
		}
		e.stat.projectileCount.ClearOperation();
		e.stat.projectileCount.AddMultiply(0,1000000);
		e.stat.projectileCount.AddAdd(1,1000001);

		e.stat.projectile=ProjectileData.nameToData["EnergyOrb"];
		lastBurstShotFired=shotFired;
		shotFired=0;
	}

	protected override void ProjectileFiringEventHandler(object _sender,ProjectileEventArgs e) {
		base.ProjectileFiringEventHandler(_sender,e);
		e.stat.damage.AddDivideAdd(lastBurstShotFired*0.2f-0.4f,0);
		lastBurstShotFired=2;
	}

}